package com.woniuxy.house.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * 用户房源中间表mapper接口
 */
public interface UserAndSourceMapper {
    /**
     * 增加（用户关注房源，即增加此表）
     * @param userId
     * @param sourceId
     */
    @Insert("insert into house_user_source (user_id,source_id) values (#{userId},#{sourceId})")
    void add(@Param("userId")int userId, @Param("sourceId")int sourceId);


    /**
     * 删除（用户取消关注 即删除）
     * @param userId
     * @param sourceId
     */
    @Delete("delete from house_user_source where user_id=#{userId} and source_id=#{sourceId}")
    void delete(@Param("userId")int userId, @Param("sourceId")int sourceId);
}
